using UnityEngine;
using System.Collections;

public class DoorOpenState : State<DoorControl> 
{
    #region Singleton

    private static DoorOpenState instance = new DoorOpenState();
    public static DoorOpenState Instance { get { return instance; } }
    private DoorOpenState() { }

    #endregion

    #region State

    public override void OnEnter(DoorControl behaviour)
    {
        behaviour.PlayAnimation(AnimationConstants.DOOR_OPEN);
        behaviour.gameObject.layer = TagConstants.LAYER_NUMBER_IGNORE_RAYCAST;
    }

    public override void OnUpdate(DoorControl behaviour)
    {
        
    }

    public override void OnExit(DoorControl behaviour)
    {
        
    }

    public override void OnAction(string name, DoorControl behaviour, object value)
    {
        switch (name)
        {
            case ActionConstants.CLOSE:
            case ActionConstants.SWITCH:
                behaviour.State = DoorCloseState.Instance;
                break;
        }
    }

    #endregion
}
